package com.simple.handler.demo003.constants;

import com.simple.handler.demo003.entities.GetewayEntity;

public enum GetewayEnum {

    /**
     * 在这里大家需要注意到一个点 api接口限流是第一个处理者 因此没有 prehandlerId，也就是 它的prehandlerId = null
     */
    API_HANDLER(new GetewayEntity(1,"api接口限流","com.simple.handler.demo003.ApiLimitGetewayHandler",null,2)),
    BLACKLIST_HANDLER(new GetewayEntity(2,"黑名单拦截","com.simple.handler.demo003.BlacklistGetwayHandler",1,3)),
    SESSION_HANDLER(new GetewayEntity(3,"用户会话拦截","com.simple.handler.demo003.SessionGetwayHandler",2,4)),

    /**
     * 这是最后一个处理者，因此没有下一个 nexthandlerId 也就是它的 nexthandlerId = null
     */
    PARAM_HANDLER(new GetewayEntity(4,"参数过滤拦截","com.simple.handler.demo003.ParamGetwayHandler",3,null)),

    ;

    GetewayEntity getewayEntity;

    public GetewayEntity getGetewayEntity() {
        return getewayEntity;
    }

    GetewayEnum(GetewayEntity getewayEntity) {
        this.getewayEntity = getewayEntity;
    }
}
